package com.afc.struts.form.generator;

public interface Api
{
  public String getName();
  public void setName(String aName);

  public String getDescription();
  public void setDescription(String aDescription);

  public class DefaultApi implements Api
  {
    public DefaultApi(String aName, String aDescription)
    {
      name = aName;
      description = aDescription;
    }

    @Override
    public String getName()
    {
      return name;
    }

    @Override
    public void setName(String aName)
    {
      name = aName;
    }

    @Override
    public String getDescription()
    {
      return description;
    }

    @Override
    public void setDescription(String aDescription)
    {
      description = aDescription;
    }

    @Override
    public boolean equals(Object anObject)
    {
      return (anObject instanceof Api && name.equals(((Api)anObject).getName()) && description.equals(((Api)anObject).getDescription()));
    }

    @Override
    public int hashCode()
    {
      return name.hashCode() + description.hashCode();
    }

    protected String name;
    protected String description;
  }
}
